package com.android.aiod.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.view.WindowManager;

import com.android.aiod.R;
import com.gyf.immersionbar.ImmersionBar;

/**
 * Created by Administrator on 2018/7/21.
 */

public class LoadingActivity extends BaseActivity {

    Handler handler = new Handler();
    Context mContext;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_loading;
    }

    @Override
    protected void initView() {
        ImmersionBar.with(this).statusBarDarkFont(true).navigationBarDarkIcon(true).init();
        mContext = this;
        setContentView(R.layout.activity_loading);
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                goToMain();
            }
        }, 1500);
    }

    @Override
    protected void initData() {
    }

    //跳首页
    private void goToMain() {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        Intent intent;
        intent = new Intent(mContext, HomeActivity.class);
        mContext.startActivity(intent);
        overridePendingTransition(R.anim.main_activity_in, R.anim.splash_out);
        finish();
    }


}
